/*
 * @Author       : Darcy
 * @Date         : 2021-04-09 17:06:54
 * @LastEditors  : Darcy
 * @LastEditTime : 2021-04-14 16:56:05
 * @FilePath     : \HelloWorld\Cpp\TXExersice\04\T2.cpp
 * @Description  : <(￣︶￣)↗[GO!]
 * https://github.com/Darcy-Zhang
 */
#include <iostream>
using namespace std;

class RECT {
  public:
    RECT(double x1, double y1);
    virtual ~RECT() = default;
    double peri();
    virtual double area();
    virtual int isSquare();

  protected:
    double x, y;
};

class CUB : public RECT {
  public:
    CUB(double x1, double y1, double z1) : RECT(x1, y1) { height = z1; }
    double volume();
    virtual double area() override;
    virtual int isSquare() override;

  private:
    double height;
};

RECT::RECT(double x1, double y1) {
    x = x1;
    y = y1;
}

double RECT::area() { return x * y; }

double RECT::peri() { return 2 * x + 2 * y; }

int RECT::isSquare() {
    return (x - y <= 0.00000000000000001 && y - x <= 0.00000000000000001) ? 1
                                                                          : 0;
}

double CUB::volume() { return RECT::area() * height; }

double CUB::area() { return 2 * RECT::area() + RECT::peri() * height; }

int CUB::isSquare() {
    if (RECT::isSquare() == 1)
        if ((height * height) - RECT::area() <= 0.00000000000000001 &&
            RECT::area() - (height * height) <= 0.00000000000000001)
            return 1;
    return 0;
}

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    CUB cu(a, b, c);
    RECT *re = &cu;
    cout << cu.volume() << endl;
    cout << re->area() << endl;
    if (re->isSquare())
        cout << "是正方体" << endl;
    else
        cout << "不是正方体" << endl;
    return 0;
}
